//
//  HomeViewController.m
//  Loan
//
//  Created by hejinhui on 2017/11/7.
//  Copyright © 2017年 hejinhui. All rights reserved.
//

#import "HomeViewController.h"
#define home_Height        Screen_Height == 818 ? Screen_Height - 83 : Screen_Height - 49
#define Top_Height         Screen_Height == 818 ? 44 : 20
@interface HomeViewController ()

@property (nonatomic,strong)UIImageView *bgImgView; //背景
@property (nonatomic,strong)UIImageView *roundImgView;//圆
@end

@implementation HomeViewController

- (void)viewWillAppear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
    
    
}

- (void)viewWillDisappear:(BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    [self initializeDataSource];
    [self initializeInterface];
    
   
    
}

#pragma mark - initializeDataSource
- (void)initializeDataSource
{
    
}

#pragma mark - initializeInterface
- (void)initializeInterface
{
   
    self.bgImgView.image = [UIImage imageNamed:@"beijing"];
    self.roundImgView.image = [UIImage imageNamed:@"圈"];
    
    //
    for (NSInteger index = 0; index < 2; index ++) {
        UIButton *topClickBtn = [UIButton new];
        [self.view addSubview:topClickBtn];
        [topClickBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
        [topClickBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(Top_Height);
            make.left.equalTo(self.view).offset(25 + (Screen_Width - 69) * index);
            make.width.height.mas_equalTo(44);
        }];
        
    }
    
}

#pragma mark - 懒加载
- (UIImageView *)bgImgView
{
    if (!_bgImgView) {
        _bgImgView = [[UIImageView alloc]init];
        [self.view addSubview:_bgImgView];
        [_bgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.trailing.leading.mas_equalTo(0);
            make.height.mas_equalTo(home_Height);
        }];
    }
    return _bgImgView;
}

- (UIImageView *)roundImgView
{
    if (!_roundImgView) {
        _roundImgView = [[UIImageView alloc]init];
        [self.view addSubview:_roundImgView];
        [_roundImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.mas_equalTo(50);
            make.trailing.mas_equalTo(-50);
            make.top.mas_equalTo(150);
            make.height.mas_equalTo(Screen_Width - 100);
        }];
    }
    return _roundImgView;
}


@end
